@echo off
for %%f in (./protobuf/*.proto) do (
    echo Processing file: %%f
    npx pbjs --dependency protobufjs/minimal.js --target static-module --wrap commonjs --out ./ts/%%~nf.js ./protobuf/%%f
    npx pbts --main --out ./ts/%%~nf.d.ts ./ts/%%~nf.js && node ./wrap-pbts-result.js %%~nf
)